package com.syh.jn.scm.domain.downstream.entity.base;

import cn.redscarf.commons.util.bean.ExtBeanUtils;
import com.syh.core.ddd.domain.AbstractSimpleAggregate;
import com.syh.jn.scm.dto.downstream.base.DownBusinessEntityExtGoodsInfoMto;
import com.syh.jn.scm.dto.downstream.base.DownBusinessEntityExtGoodsInfoSto;
import lombok.AccessLevel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 商品拓展编码
 */
@Data
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@EqualsAndHashCode(callSuper = true)
public class DownBusinessEntityExtGoodsInfo extends AbstractSimpleAggregate<Long> {

  public DownBusinessEntityExtGoodsInfo(DownBusinessEntityExtGoodsInfoSto sto) {
    super.initDefault();
    this.terminalType = "DOWNSTREAM";
    ExtBeanUtils.copyProperties(sto, this);
  }

  /**
   * 修改扩展编码
   *
   * @param mto
   */
  public void modify(DownBusinessEntityExtGoodsInfoMto mto) {
    ExtBeanUtils.copyProperties(mto, this);
    this.lastUpdateTimeStamp = System.currentTimeMillis();
  }

  /**
   * 删除扩展编码
   */
  public void destroy() {

  }

  /**
   * 商品id
   */
  private Long goodsId;
  /**
   * 数据归属经营主体id
   */
  private Long businessEntityId;
  /**
   * 商品扩展编号
   */
  private String goodsExtCode;
  /**
   * 所属终端系统:DOWNSTREAM,OPERATION,SUPPLIER,UPSTREAM
   */
  private String terminalType;
}
